package com.max.spark.oracle

import com.max.spark.utils.SparkUtil

object OracleSparkApp {
  def main(args: Array[String]): Unit = {

    // 简单示例，其他操作和mysql类似
    val spark = SparkUtil.sparkSession()
    val empDF = spark.read
    .format("jdbc")
    .option("url", "jdbc:oracle:thin:system/oracle@//localhost:1521/xe")
    .option("dbtable", "emp")
    .option("user", "system")
    .option("password", "oracle")
    .option("driver", "oracle.jdbc.driver.OracleDriver")
    .load()
    empDF.printSchema()
    empDF.show()
  }
}
